habiticafandomcom-20200222-history
Setting up Habitica Locally on Windows
These steps are taken from the git installation instructions above. There are multiple ways to install git on Windows. Listed below are the two easiest ways: * Download the most official build on the Git website . This download will start automatically. Or * Download GitHub Desktop. This also includes the command line version of Git. IMPORTANT! When presented with the "Configuring the line ending conversions" window, select "Checkout as-is, commit Unix-style line endings". Alternatively, after you have finished installing git, you can configure that setting from the command line by running git config --global core.autocrlf input This is necessary because Windows handles line endings differently than other operating systems. It uses a combination of a carriage return and line feed, \r\n (CRLF), while Unix/Linux/MacOS systems use only the line feed (LF) character \n. To force Windows to be compatible, you must set up Git to ensure that only LF line endings are committed to Habitica's GitHub repository. For further information on line endings and whitespace in Git, see the "Formatting and Whitespace" section in the Pro Git book. If you don't want to set the core.autocrlf setting globally, see Dealing with line endings > Per-repository settings to learn how to set it for individual repositories. This will only be relevant to you if you are already using Git for other projects or will be using it for others in future. Putting Git in your PATH Variable It is important that the location of git is added to your PATH environment variable. The git installer might give you an option to do that. If it doesn't, after git is installed, find where the executable file has been placed and add that directory to your PATH variable in the standard way for modifying the PATH on Windows. If you need help with this, ask in the Aspiring Blacksmiths guild. If you are aware of the best way to ensure that the PATH is modified appropriately, please update these instructions. Setting the PATH for Windows 10 Users #Go to the Control Panel (aka Windows Settings), type 'environment variables' into the search field. #Select Edit the System Environment Variables, and then click the Environment Variables button at the bottom of the System Properties dialog box. #Select Path, click Edit, and then add the line for Git (default installation: C:\Program Files\Git\bin) to a new line. #Click OK to save the path addition. To ensure that git is in your path. Open a windows command prompt and type git --help Press Enter and if you see a list of available git commands then you have added git to the path properly. Install Build Tools Install the Visual C++ 2015 build tools. This step might not be necessary but recent contributors using Windows installs have indicated that it might be needed for some of Habitica's dependencies to be installed (e.g., bcrypt). If you have feedback about this, please post to the Aspiring Blacksmith's guild. Install Node and NPM This section takes you through the process of installing node and npm. Note that the sample command below is for reference only and might not contain the correct version of npm so be sure to adjust the command as needed before you run it. The versions that must be used are #Download and run the latest Node.js msi installation file. #Launch a command window as Administrator and in that window: ##Check that you installed node successfully and that it is the correct version (if it is not, redo the node installation using the correct download): node -v ##Installing NodeJS also installs npm. Check that that has been done and that the version is correct: npm -v ##*If the version of npm is wrong, install the correct version. For example, if npm 6 needed to be installed: npm install -g npm@6 Install some dependencies necessary for the bcrypt package: npm install -g node-gyp npm install -g --production windows-build-tools If you later experience errors with bcrypt, you might need to install some extra dependencies listed here: https://github.com/kelektiv/node.bcrypt.js#dependencies . If you have any feedback about that, or experience problems with it, please post to the Aspiring Blacksmiths guild so that we can improve this documentation. Create a directory by executing mkdir website\build If it gives you an error that the directory already exists, ignore the error and proceed with the next step Close any applications or file explorer windows that might be reading your local copy of the repository. The installation steps below might fail if any of the files are locked by any Windows processes. For antivirus software, make an exception in its settings so that it won't scan the repository until the install is complete. For reference, see from this GitHub comment to the end of the issue. Category:Contributing